package com.moguhoutai.biz;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.moguhoutai.dao.CustomerMapper;
import com.moguhoutai.model.Customer;
import com.moguhoutai.util.BusinessException;

@Service
public class CustomerBiz {
	@Resource
	private CustomerMapper customerDAO;
	
	public List<Customer> findAll ()throws BusinessException{
		try {
			return customerDAO.findAll();
		} catch (Exception e) {
			e.printStackTrace();
		}
		throw new BusinessException("");
	}
	public long findCount() throws BusinessException {
		try {
			return customerDAO.findCount();
		} catch (Exception e) {
			e.printStackTrace();
			throw new BusinessException("E01B06");
		}
	}
	
	public Customer findByName(String name)throws BusinessException{
		try {
			return customerDAO.findByName(name);
		} catch (Exception e) {
			e.printStackTrace();
		}
		throw new BusinessException("");
	}
}
